/*
 * Description: 命名管道帮助类
 */
#include "common_header.h"
#include <thread>
#include <mutex>

class NamedPipeUtil {
public:
    NamedPipeUtil() = default;
    ~NamedPipeUtil() = default;
    static NamedPipeUtil& GetInstance();
    bool Init();
    void DeInit();
    void Send(const std::string& msg);
    void Recv();
private:
    bool OpenPipe();
private:
    HANDLE pipeHandle = INVALID_HANDLE_VALUE;
    std::thread recvThread;
    bool stopFlag = false;
    std::mutex sendMtx;
};

